<?php
include_once ("impl/SessionImpl.php");				//-- Session

$sessionImpl = new SessionImpl(DB_TAG_SYSTEM);				//-- session


				
/*----- check session -----*/
if($sessionImpl->isExisted()) {
	$gid = $sessionImpl->getGroupID();
	$uid = $sessionImpl->getUserID();
	
	//check user group
	
	if($gid > 4){
		$loc = './login.php';
		header("Location: $loc");
		exit;
	}
}else{
	header("Location: ./login.php");
	exit;
}

if(isset($_GET["Lan"])){
	$arrLan = array("lan" => $_GET["Lan"]);
	$sessionImpl->add($arrLan);
}

if($sessionImpl->getLanguage() == "zh-CN"){
	include_once("zh-CN.inc.php");	//--> zh_CN
}else{
	include_once("en-US.inc.php");	//--> us_EN
}

if(isset($_GET['menuGid']) && isset($_GET['menuid'])){
	$menuGid 	= $_GET['menuGid'];
	$menuid 	= $_GET['menuid'];
	$id			= $_GET['id'];
}else{
	$menuGid 	= $_POST['menuGid'];
	$menuid 	= $_POST['menuid'];
	$id			= $_POST['id'];
}

if(isset($_POST['backurl']))
	$backurl = $_POST['backurl'];
else
	$backurl = $_SERVER['HTTP_REFERER'];
	
?>